import { CoolController, BaseController } from "@cool-midway/core";
import { ProviderInfoEntity } from "../../entity/info";
import { ProviderProfileEntity } from "../../entity/profile";

/**
 * 服务人员信息管理
 */
@CoolController({
    api: ['add', 'delete', 'update', 'info', 'list', 'page'],
    entity: ProviderInfoEntity,
    // 配置列表查询
    pageQueryOp: {
        // 支持模糊搜索的字段
        keyWordLikeFields: ['a.phone', 'b.name'],
        // 筛选字段
        fieldEq: ['a.status'],
        // 关联查询
        select: ['a.*', 'b.name', 'b.gender', 'b.photo', 'b.comprehensiveScore', 'b.experienceYears'],
        join: [
            {
                entity: ProviderProfileEntity,
                alias: 'b',
                condition: 'a.id = b.providerId',
                type: 'leftJoin'
            }
        ]
    }
})
export class AdminProviderInfoController extends BaseController { }

